﻿// Tribe Framework by Chinajade.
//
// LICENSE:
// This work is licensed under the
//     Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
// also known as CC-BY-NC-SA.  To view a copy of this license, visit
//      http://creativecommons.org/licenses/by-nc-sa/3.0/
// or send a letter to
//      Creative Commons // 171 Second Street, Suite 300 // San Francisco, California, 94105, USA.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

using Styx;


namespace Chinajade.Tribe
{
    public class TribePaths
    {
        public TribePaths(string packageName = "TRIBE_UNNAMED")
        {
            packageName = packageName ?? "";

            _packageName = packageName;
        }

        private string _packageName;


        /// <summary>
        /// 
        /// </summary>
        public string CombatRoutineDirectory
        {
            get
            {
                return (_combatRoutineDirectory
                        ?? (_combatRoutineDirectory = Path.Combine(CombatRoutinesDirectory, _packageName))
                        );
            }
        }
        
        /// <summary>
        /// 
        /// </summary>
        public string CombatRoutinesDirectory
        {
            get
            {
                return (_combatRoutinesDirectory
                        ?? (_combatRoutinesDirectory = Path.Combine(Styx.Common.Utilities.AssemblyDirectory,
                                                                    Styx.Helpers.GlobalSettings.Instance.CombatRoutinesPath))
                        );
            }
        }


        /// <summary>
        /// 
        /// </summary>
        public string PluginDirectory
        {
            get
            {
                return (_pluginDirectory
                        ?? (_pluginDirectory = Path.Combine(PluginsDirectory, _packageName))
                        );
            }
        }
        

        /// <summary>
        /// 
        /// </summary>
        public string PluginsDirectory
        {
            get
            {
                return (_pluginsDirectory
                        ?? (_pluginsDirectory = Path.Combine(Styx.Common.Utilities.AssemblyDirectory,
                                                             Styx.Helpers.GlobalSettings.Instance.PluginsPath))
                        );
            }
        }


        /// <summary>
        /// 
        /// </summary>
        public string PluginResourcesDirectory
        {
            get
            {
                return (_pluginResourcesDirectory
                        ?? (_pluginResourcesDirectory = Path.Combine(PluginDirectory, "PackageResources"))
                        );
            }
        }


        /// <summary>
        /// 
        /// </summary>
        public string QuestBehaviorsDirectory
        {
            get
            {
                return (_questBehaviorsDirectory
                        ?? (_questBehaviorsDirectory = Path.Combine(Styx.Common.Utilities.AssemblyDirectory,
                                                                    Styx.Helpers.GlobalSettings.Instance.QuestBehaviorsPath))
                        );
            }
        }
        
        
        /// <summary>
        /// 
        /// </summary>
        public string SettingsDirectory_Character
        {
            get
            {
                return (_settingsDirectory_Character
                    ?? (_settingsDirectory_Character = Path.Combine(Styx.Helpers.GlobalSettings.CharacterSettingsDirectory,
                                                                    _packageName))
                    );
            }
        }


        /// <summary>
        /// 
        /// </summary>
        public string SettingsDirectory_Global
        {
            get
            {
                return (_settingsDirectory_Global
                    ?? (_settingsDirectory_Global = Path.Combine(Styx.Helpers.GlobalSettings.SettingsDirectory,
                                                                 _packageName))
                    );
            }
        }


        private string _combatRoutineDirectory;
        private string _combatRoutinesDirectory;
        private string _pluginDirectory;
        private string _pluginResourcesDirectory;
        private string _pluginsDirectory;
        private string _questBehaviorsDirectory;
        private string _settingsDirectory_Character;
        private string _settingsDirectory_Global;
    }
}
